#__author__ = 'bruce.li'
# coding:utf-8

from common.readelement import Element
from page_object.webpage import WebPage

publish = Element('jzsz/enterprise/shared_employment')

class SharedEmploymentProPage(WebPage):
    """发布富余人员"""

    def join_enterprise_center(self):
        self.is_click(publish["进入企业中心"])

    def share_manager(self):
        self.is_click(publish["共享用工管理"])

    def rich_person(self):
        self.is_click(publish["富余人员TAB"])

    def post_release(self):
        self.is_click(publish["富余发布工种"])

    def add_position(self):
        self.is_click(publish["添加岗位"])

    def post_info(self, man, woman, contacts, phone):
        """填写岗位信息"""
        self.input_text(publish["男性人数"], man)
        self.input_text(publish["女性人数"], woman)
        self.input_text(publish["联系人"], contacts)
        self.input_text(publish["联系方式"], phone)

    def confirm(self):
        self.is_click(publish["确定"])

    def release(self):
        self.is_click(publish["发布"])

    def release_result(self):
        return self.is_exists(publish["富余人员TAB"])


class SharedEmploymentNeedPage(WebPage):
    """发布缺工岗位"""

    def join_enterprise_center(self):
        self.is_click(publish["进入企业中心"])

    def share_manager(self):
        """进入共享用工管理"""
        self.is_click(publish["共享用工管理"])

    def post_release(self):
        self.is_click(publish["缺工发布工种"])

    def add_position(self):
        self.is_click(publish["添加岗位"])

    def post_info(self, jobname, man, woman, contacts, phone):
        """填写岗位信息"""
        self.input_text(publish["岗位名称"], jobname)
        self.input_text(publish["男性人数"], man)
        self.input_text(publish["女性人数"], woman)
        self.input_text(publish["联系人"], contacts)
        self.input_text(publish["联系方式"], phone)

    def confirm(self):
        self.is_click(publish["确定"])

    def release(self):
        self.is_click(publish["发布"])

    def release_result(self):
        return self.is_exists(publish["缺工岗位TAB"])